/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wangxin
 * Date: 2024-08-27
 * Time: 15:11
 */
//public class Students {
//    public String name;
//    public String gender;
//    public int age;
//
//    public static String classRoom = "Bit306";
//   public  Students(String name,String gender,int age){
//       this.name = name;
//       this.gender = gender;
//       this.age = age;
//
//   }
//    public static void main(String[] args) {
//
//        System.out.println(Students.classRoom);
//        Students s1 = new Students("Li lei", "男", 18);
//        Students s2 = new Students("Han MeiMei", "女", 19);
//        Students s3 = new Students("Jim", "男", 18);
//
//        System.out.println(s1.classRoom);
//        System.out.println(s2.classRoom);
//        System.out.println(s3.classRoom);
//    }
//}
//public class Students {
//    private String name;
//    public String gender;
//    public int age;
//
//    public static String classRoom = "Java306";
//    public  Students(String name,String gender,int age){
//        this.name = name;
//        this.gender = gender;
//        this.age = age;
//
//    }
//    public String getName(){
//      classRoom = "Java112";
//        return name;
//    }
//    public static String getClassRoom(){
//
//        return classRoom;
//    }
//
//    public static void main(String[] args) {
//
//
//        Students s1 = new Students("Li lei", "男", 18);
//        s1.getName();
//        System.out.println(Students.getClassRoom());
//
//
//    }
//}
//public class Students {
//    public String name;
//    public String gender;
//    public int age;
//
//    public static String classRoom = "Java306";
//   public  Students(String name,String gender,int age){
//       this.name = name;
//       this.gender = gender;
//       this.age = age;
//
//   }
//    public void doClass(){
//      classRoom = "12345";
//
//    }
//    public static String getClassRoom(){
//
//       return classRoom;
//    }
//    public static void main(String[] args) {
//
//        System.out.println(Students.classRoom);
//        Students s1 = new Students("Li lei", "男", 18);
//
//
//
//    }
//}
//public class Students {
//    public String name;
//    public String gender;
//    public int age;
//
//    public static String classRoom = "Bit306";
//   public  Students(String name,String gender,int age){
//       this.name = name;
//       this.gender = gender;
//       this.age = age;
//
//   }
//    public static void main(String[] args) {
//
//        System.out.println(Students.classRoom);
//    }
//
//}
//public class Students {
//    public String name;
//    public String gender;
//    public int age;
//    public double score;
//    public Students() {
//        System.out.println("I am Student init()!");
//    }
//    //实例代码块
//    {
//        this.name = "bit";
//        this.age = 12;
//        this.gender = "man";
//        System.out.println("I am instance init()!");
//    }
//    public void show(){
//        System.out.println("name: "+name+" age: "+age+" gender: "+gender);
//    }
//    public static void main(String[] args) {
//        Students stu = new Students();
//        stu.show();
//    }
//}
public class Students{
    private String name;
    private String gender;
    private int age;
    private double score;
    private static String classRoom;
    // 静态代码块
    static {
        classRoom = "java306";
        System.out.println("I am static java306!");
    }
    public Students(){
        System.out.println("I am Student init()!");
    }
    static {
        classRoom = "java123";
        System.out.println("I am static java123!");
    }
    public static String getClassRoom(){
        return classRoom;
    }
    public static void main(String[] args) {
        Students s = new Students();
        System.out.println(s.getClassRoom());
    }
}


